import jdk.swing.interop.SwingInterOpUtils;
import java.util.GregorianCalendar;


/**
 * Created with IntelliJ IDEA.
 * Description:BOKD
 * User: 34321
 * Date: 2024-11-03
 * Time: 15:11
 */

public class UnderGraduate {
    private int height;//身高
    private int weight;//体重
    public String gender;//性别
    public String specialty;//专业
    int classandgrade;//年级和班级 -->>default属性

    public UnderGraduate(int height,int weight,String gender,String specialty,int classandgrade){
        this.height = height;
        this.weight = weight;
        this.gender = gender;
        this.specialty = specialty;
        this.classandgrade = classandgrade;

    }

    public void Sleep(){
        System.out.println("Slepp~~~~~~");
    }

    public void Forget(){
        System.out.println("Forget~~~~~~");
    }

    public void Eat(){
        System.out.println("Eat~~~~~~");
    }


    public class TestUndergraduate{
        public static void main(String[] args) {
            UnderGraduate g1 = new UnderGraduate(173,59,"man","computer scicence and technology",241);
            System.out.println(g1.height);// private属性：只能在Computer类中访问，不能被其他类访问
            System.out.println(g1.weight);// private属性：只能在Computer类中访问，不能被其他类访
            System.out.println(g1.gender); // public属性： 可以任何其他类访问
            System.out.println(g1.specialty); // public属性： 可以任何其他类访问
            System.out.println(g1.classandgrade);// default属性：只能被本包中类访问
        }
    }

    public static void main(String[] args) {
        UnderGraduate g2 = new UnderGraduate(172,59,"boy","computer science and technology",241);
        System.out.println(g2.height);
        System.out.println(g2.weight);
        System.out.println(g2.gender);
        System.out.println(g2.specialty);
        System.out.println(g2.specialty);
    }

}
